package com.edu.study.base.lmsOrderOperateHistory.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.edu.study.base.lmsOrderOperateHistory.domain.LmsOrderOperateHistory;
import com.edu.study.base.lmsOrderOperateHistory.service.ILmsOrderOperateHistoryService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * LmsOrderOperateHistoryController
 * 
 * @author zw
 * @date 2021-08-11
 */
@RestController
@RequestMapping("/LmsOrderOperateHistory/LmsOrderOperateHistory")
public class LmsOrderOperateHistoryController extends BaseController
{
    @Autowired
    private ILmsOrderOperateHistoryService lmsOrderOperateHistoryService;

    /**
     * 查询LmsOrderOperateHistory列表
     */
    @PreAuthorize("@ss.hasPermi('LmsOrderOperateHistory:LmsOrderOperateHistory:list')")
    @GetMapping("/list")
    public TableDataInfo list(LmsOrderOperateHistory lmsOrderOperateHistory)
    {
        startPage();
        List<LmsOrderOperateHistory> list = lmsOrderOperateHistoryService.selectLmsOrderOperateHistoryList(lmsOrderOperateHistory);
        return getDataTable(list);
    }

    /**
     * 导出LmsOrderOperateHistory列表
     */
    @PreAuthorize("@ss.hasPermi('LmsOrderOperateHistory:LmsOrderOperateHistory:export')")
    @Log(title = "LmsOrderOperateHistory", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(LmsOrderOperateHistory lmsOrderOperateHistory)
    {
        List<LmsOrderOperateHistory> list = lmsOrderOperateHistoryService.selectLmsOrderOperateHistoryList(lmsOrderOperateHistory);
        ExcelUtil<LmsOrderOperateHistory> util = new ExcelUtil<LmsOrderOperateHistory>(LmsOrderOperateHistory.class);
        return util.exportExcel(list, "LmsOrderOperateHistory");
    }

    /**
     * 获取LmsOrderOperateHistory详细信息
     */
    @PreAuthorize("@ss.hasPermi('LmsOrderOperateHistory:LmsOrderOperateHistory:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(lmsOrderOperateHistoryService.selectLmsOrderOperateHistoryById(id));
    }

    /**
     * 新增LmsOrderOperateHistory
     */
    @PreAuthorize("@ss.hasPermi('LmsOrderOperateHistory:LmsOrderOperateHistory:add')")
    @Log(title = "LmsOrderOperateHistory", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody LmsOrderOperateHistory lmsOrderOperateHistory)
    {
        return toAjax(lmsOrderOperateHistoryService.insertLmsOrderOperateHistory(lmsOrderOperateHistory));
    }

    /**
     * 修改LmsOrderOperateHistory
     */
    @PreAuthorize("@ss.hasPermi('LmsOrderOperateHistory:LmsOrderOperateHistory:edit')")
    @Log(title = "LmsOrderOperateHistory", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody LmsOrderOperateHistory lmsOrderOperateHistory)
    {
        return toAjax(lmsOrderOperateHistoryService.updateLmsOrderOperateHistory(lmsOrderOperateHistory));
    }

    /**
     * 删除LmsOrderOperateHistory
     */
    @PreAuthorize("@ss.hasPermi('LmsOrderOperateHistory:LmsOrderOperateHistory:remove')")
    @Log(title = "LmsOrderOperateHistory", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(lmsOrderOperateHistoryService.deleteLmsOrderOperateHistoryByIds(ids));
    }
}
